import request from '@/utils/request'

// 查询合同模板列表
export function contractTemplateList(query) {
  return request({
    url: '/contractTemplate/contractTemplate/list',
    method: 'get',
    params: query
  })
}

// 详情
export function contractTemplateDetails(id) {
    return request({
        url: `/contractTemplate/contractTemplate/${id}`,
        method: 'get'
    })
}

// 查询合同模板参数
export function contractTemplateParam(query) {
    return request({
        url: `/contractTemplate/contractTemplateParam/allList`,
        method: 'get',
        params: query
    })
}


// 保存
export function contractTemplateAdd(data) {
  return request({
    url: '/contractTemplate/contractTemplate',
    method: 'post',
    data:data
  })
}

// 编辑
export function contractTemplateUpdate(data) {
  return request({
    url: '/contractTemplate/contractTemplate',
    method: 'put',
    data:data
  })
}

// 保存and提交审批
export function submitForApproval(data) {
  return request({
    url: '/contractTemplate/contractTemplate/submitForApproval',
    method: 'post',
    data:data
  })
}

// 列表发起审批
export function initiateApproval(id) {
    return request({
        url: `/contractTemplate/contractTemplate/initiateApproval/${id}`,
        method: 'post'
    })
}

//审核
export function contractTemplateAudit(data) {
    return request({
        url: '/contractTemplate/contractTemplate/audit',
        method: 'post',
        data:data
    })
}

export function enableVerify(id) {
    return request({
        url: `/contractTemplate/contractTemplate//enableVerify/${id}`,
        method: 'put'
    })
}

//启用
export function contractTemplateEnable(id) {
    return request({
        url: `/contractTemplate/contractTemplate/enable/${id}`,
        method: 'put'
    })
}

//禁用
export function contractTemplateDisable(ids) {
    return request({
        url: `/contractTemplate/contractTemplate/disable/${ids}`,
        method: 'put'
    })
}

// 审批记录
export function getFlowRecord(id) {
  return request({
    url: `/contractTemplate/contractTemplate/getFlowRecord/${id}`,
    method: 'get'
  })
}

// 删除
export function contractTemplateDelete(ids) {
  return request({
    url: `/contractTemplate/contractTemplate/${ids}`,
    method: 'delete'
  })
}


//管理客户前校验
export function manageCustomersVerify(data) {
    return request({
        url: '/contractTemplate/contractTemplate/manageCustomersVerify',
        method: 'post',
        data:data
    })
}

//管理客户
export function contractTemplateManageCustomers(data) {
    return request({
        url: '/contractTemplate/contractTemplate/manageCustomers',
        method: 'post',
        data:data
    })
}

// 审批记录
export function contractTemplateGetFlowRecord(id) {
    return request({
        url: `/contractTemplate/contractTemplate/getFlowRecord/${id}`,
        method: 'get'
    })
}

// 操作记录
export function contractTemplateLog(id) {
    return request({
        url: `/contractTemplate/contractTemplate/log/${id}`,
        method: 'get'
    })
}

//通用-产品方案列表查询接口
export function planList(data) {
    return request({
        url: '/quoter/scheme/common/list',
        method: 'post',
        data:data
    })
}
